package com.XinYun.Library.modules.Register.Service.Impl;

import com.XinYun.Library.modules.Register.Service.AllService;
import com.XinYun.Library.utils.FormatUtil.FormatUtil;

public class AllServiceImpl implements AllService {
    UserServiceImpl userService = new UserServiceImpl();

    /**
     * 判断是否注册成功
     * @param intername
     * @param sid
     * @param password
     * @param mail
     * @return
     * @throws Exception
     */
    @Override
    public boolean isRegister(String intername, String sid, String password, String mail) throws Exception {
        if(userService.isExist(sid)){
            return false;
        }else if(FormatUtil.isEmail(mail)){
            return userService.insert(intername, sid, password, mail);
        }
        return true;
    }
}
